package cn.springcloud.fix.demo.common;

import java.sql.SQLException;

public class Person {

    /*Class.forName("com.mysql.jdbc.Driver");

    static {
        try {
            java.sql.DriverManager.registerDriver(new Driver());
        } catch (SQLException E) {
            throw new RuntimeException("Can't register driver!");
        }
    }*/

    static {
        //Class.forName("cn.springcloud.fix.demo.common.Person")就是把Person类进行装载
        System.out.println("装载的时候就会执行static方法");
    }

    public String name;

    private int age;

    public Person() {
        System.out.println("无参构造方法");
    }

    public Person(int age) {
        System.out.println("带参构造方法");
    }

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public static void show(int age) {
        System.out.println("show:" + age);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
